package org.training.apr.model.utils.builder;

import org.training.apr.model.Role;
import org.training.apr.model.User;

public class UserBuilder extends Builder {
	private String username = "User #" + id;
	private String password = "passwd" + id;
	private Role role = new RoleBuilder().build();
	
	public UserBuilder withUsername(String username) {
		this.username = username;
		return this;
	}
	
	public UserBuilder withPassword(String password) {
		this.password = password;
		return this;
	}
	
	public UserBuilder withRole(Role role) {
		this.role = role;
		return this;
	}
	
	public User build() {
		User user = new User();
		
		user.setId(id);
		user.setUsername(username);
		user.setPassword(password);
		user.setRole(role);
		
		return user;
	}
}
